"In this tutorial we are going to program the left arrow and fix the bug when we reach the end at scrolling. So, when the last picture is reached, we want the script to recognize it and move us to the first image. And the same for scrolling back - when the first picture is reached, proceed with the last one."
http://www.mybringback.com/?p=13838